Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): revert functionality to remember last workspace opened #523

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

KaWaite
Copy link
Member

@KaWaite KaWaite commented Jun 26, 2023

Overview

We were getting an infinite loop on the Dashboard that was hurting the server (probably).
The logic around remembering the previous workspace was hard to understand and maintain, so I decided to remove that implementation so we can get Re:Earth back to a working condition and then reimplement that functionality later.

@netlify
Copy link

netlify bot commented Jun 26, 2023

Deploy Preview for reearth-web canceled.

Name Link
🔨 Latest commit e4bed61
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/649b8f9bcf54e4000822d104

@github-actions github-actions bot added the web label Jun 26, 2023
@github-actions github-actions bot requested a review from isoppp June 26, 2023 08:37
@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Merging #523 (e4bed61) into main (4b79e9d) will increase coverage by 0.03%.
The diff coverage is 1.42%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #523      +/-   ##
==========================================
+ Coverage   26.66%   26.70%   +0.03%     
==========================================
  Files        1337     1337              
  Lines      144689   144412     -277     
  Branches     3483     3481       -2     
==========================================
- Hits        38579    38560      -19     
+ Misses     104988   104730     -258     
  Partials     1122     1122              
Flag Coverage Δ
web 24.03% <1.42%> (+0.03%) ⬆️
web-beta 24.03% <1.42%> (+0.03%) ⬆️
web-classic 24.03% <1.42%> (+0.03%) ⬆️
web-utils 24.03% <1.42%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
web/src/beta/features/Navbar/hooks.ts 0.00% <0.00%> (ø)
...ponents/organisms/Authentication/RootPage/hooks.ts 0.00% <0.00%> (ø)
...rc/classic/components/organisms/Dashboard/hooks.ts 0.00% <0.00%> (ø)
...c/components/organisms/EarthEditor/Header/hooks.ts 0.00% <0.00%> (ø)
...onents/organisms/EarthEditor/PropertyPane/hooks.ts 0.00% <0.00%> (ø)
...sic/components/organisms/Settings/Account/hooks.ts 0.00% <0.00%> (ø)
...onents/organisms/Settings/Project/Dataset/hooks.ts 0.00% <0.00%> (ø)
...ponents/organisms/Settings/Project/Public/hooks.ts 0.00% <0.00%> (ø)
...sic/components/organisms/Settings/Project/hooks.ts 0.00% <0.00%> (ø)
...components/organisms/Settings/ProjectList/hooks.ts 0.00% <0.00%> (ø)
... and 5 more

... and 5 files with indirect coverage changes

@KaWaite KaWaite changed the title fix(web): remove remember last workspace fix(web): revert functionality to remember last workspace opened Jun 26, 2023
@KaWaite KaWaite merged commit 05e32d1 into main Jun 28, 2023
16 checks passed
@KaWaite KaWaite deleted the fix-infinite-loop-gql branch June 28, 2023 01:58

navigate(`/dashboard/${workspaceId}`);
} else {
setCurrentUserId(data?.me?.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function had two functionalities.

a. Handle redirect
b. Set user id if currentUserId !== data?.me?.id

This modification looks like losing b, is it merely unnecessary code?

It might be necessary when switching accounts.

setLastWorkspace(currentWorkspace);
navigate(`/dashboard/${workspaceId}`);
} else {
setCurrentUserId(data?.me?.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as other comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants